Method and device for storing and sending MAC address entry, and system

ABSTRACT

Embodiments of the present disclosure provide a method and a device for storing and sending a MAC address entry, and a system. The method includes: sending, by a PE, a first packet to an RR, so that the RR determines a MAC address entry required by the PE according to the first packet, where the RR pre-stores a MAC address table, and the MAC address table includes the required MAC address entry; and receiving, by the PE, a packet which includes the required MAC address entry and is sent by the RR, and storing the required MAC address entry.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation of U.S. patent application Ser. No.15/370,589, filed on Dec. 6, 2016, which is a continuation of U.S.patent application Ser. No. 13/764,444, filed on Feb. 11, 2013, now U.S.Pat. No. 9,531,663. The U.S. patent application Ser. No. 13/764,444claims priority to Chinese Patent Application No. 201210039632.X, filedon Feb. 21, 2012. All of the aforementioned patent applications arehereby incorporated by reference in their entireties.

TECHNICAL FIELD

The present disclosure relates to network communication technologies,and in particular, to a method and a device for storing and sending aMAC address entry, and a system.

BACKGROUND

A basic concept of an Ethernet virtual private network (EVPN) solutionis that a control plane learns a media access control (MAC) addressthrough extending a border gateway protocol (BGP), so that a layer 2virtual private network (L2VPN) function is implemented. In the EVPNsolution, each provider network edge (PE) needs to store all MAC addresstables of a virtual private network (VPN) site, to which any other PEconnects, so as to forward a data packet according to the stored MACaddress tables. The PE may also be referred to as a multi-protocol labelswitching (MPLS) edge switch (MES).

However, with the development of cloud computing, a scale of a datacenter is continuously expanding, and the number of MAC addresses risesfrom levels of K (thousand) and 10K (ten thousand) to levels of 100K(one hundred thousand) and M (Mega). In a current technology, thesolution that each PE is required to store all the MAC address tableshas high demands for both capacity and performance of the PE.

SUMMARY

Embodiments of the present disclosure provide a method and a device forstoring and sending a MAC address entry, and a system, so that a PEstores a MAC address entry according to need in an EVPN scenario anddemands for capacity and performance of the PE are reduced.

In one aspect, an embodiment of the present disclosure provides a methodfor storing a MAC address entry, where the method includes: sending, bya PE, a first packet to a route reflector RR, so that the RR determinesa MAC address entry required by the PE according to the first packet,where the RR pre-stores a MAC address table, and the MAC address tableincludes the required MAC address entry; and receiving, by the PE, apacket which includes the required MAC address entry and is sent by theRR, and storing the required MAC address entry.

In another aspect, an embodiment of the present disclosure provides amethod for sending a MAC address entry, where the method includes:receiving, by an RR, a first packet sent by a PE; determining, by theRR, a MAC address entry required by the PE according to the firstpacket, where the RR pre-stores a MAC address table including therequired MAC address entry; and sending, by the RR, the required MACaddress entry to the PE.

In one aspect, an embodiment of the present disclosure provides a devicefor storing a MAC address entry, where the device includes: a firstsending module, configured to send a first packet to an RR, so that theRR determines a MAC address entry required by the PE according to thefirst packet, where the RR pre-stores a MAC address table, and the MACaddress table includes the required MAC address entry; and a storagemodule, configured to receive a packet which includes the required MACaddress entry and is sent by the RR, and store the required MAC addressentry.

In another aspect, an embodiment of the present disclosure provides adevice for sending a MAC address entry, where the device includes: areceiving module, configured to receive a first packet sent by a PE; adetermining module, configured to determine a MAC address entry requiredby the PE according to the first packet, where the RR pre-stores a MACaddress table including the required MAC address entry; and a sendingmodule, configured to send the required MAC address entry to the PE.

An embodiment of the present disclosure further provides a networksystem, including the foregoing two devices.

It can be known from the foregoing technical solutions that, in theembodiments of the present disclosure, the PE sends the first packet tothe RR, and the RR determines the MAC address entry required by the PEaccording to the first packet, and then sends the required MAC addressentry to the PE for storing, so that the PE only stores the MAC addressentry required by itself rather than MAC address entries correspondingto all PEs, thereby implementing that the PE stores the MAC addressentry according to need, and reducing the demands for the capacity andthe performance of the PE.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a schematic flow chart of an embodiment of a method forstoring a MAC address entry according to the present disclosure;

FIG. 2 is a schematic diagram of a format of a BGP ORF packet accordingto the present disclosure;

FIG. 3a is a schematic diagram of a format of MAC ORF according to thepresent disclosure;

FIG. 3b is a schematic diagram of a format of a standard header of MACORF according to the present disclosure;

FIG. 4 is a schematic flow chart of an embodiment of a method forsending a MAC address entry according to the present disclosure;

FIG. 5 is a schematic flow chart of another embodiment of a method forstoring a MAC address entry according to the present disclosure;

FIG. 6 is a schematic flow chart of another embodiment of a method forstoring a MAC address entry according to the present disclosure;

FIG. 7 is a schematic structural diagram of an embodiment of a devicefor storing a MAC address entry according to the present disclosure;

FIG. 8 is a schematic structural diagram of another embodiment of adevice for storing a MAC address entry according to the presentdisclosure;

FIG. 9 is a schematic structural diagram of another embodiment of adevice for storing a MAC address entry according to the presentdisclosure;

FIG. 10 is a schematic structural diagram of another embodiment of adevice for storing a MAC address entry according to the presentdisclosure;

FIG. 11 is a schematic structural diagram of another embodiment of adevice for storing a MAC address entry according to the presentdisclosure;

FIG. 12 is a schematic structural diagram of another embodiment of adevice for sending a MAC address entry according to the presentdisclosure;

FIG. 13 is a schematic structural diagram of another embodiment of adevice for sending a MAC address entry according to the presentdisclosure;

FIG. 14 is a schematic structural diagram of another embodiment of adevice for sending a MAC address entry according to the presentdisclosure;

FIG. 15 is a schematic structural diagram of another embodiment of adevice for sending a MAC address entry according to the presentdisclosure;

FIG. 16 is a schematic structural diagram of another embodiment of adevice for sending a MAC address entry according to the presentdisclosure; and

FIG. 17 is a schematic structural diagram of an embodiment of a networksystem according to the present disclosure.

DETAILED DESCRIPTION OF ILLUSTRATIVE EMBODIMENTS

FIG. 1 is a schematic flow chart of an embodiment of a method forstoring a MAC address entry according to the present disclosure, wherethe method includes the following.

Step 11: A PE sends a first packet to a route reflector (RR), so thatthe RR determines a MAC address entry required by the PE according tothe first packet, where the RR pre-stores a MAC address table, and theMAC address table includes the required MAC address entry.

The first packet may be a BGP outbound router filter (ORF) packet. TheBGP ORF packet is a packet combining MAC ORF and router target (RT) ORF,where the MAC ORF includes a destination MAC address, and the RT ORFincludes an RT. The destination MAC address is a destination MAC addressincluded in a data packet received by the PE, and the RT is an RTcorresponding to a VPN to which the data packet belongs. Afterwards, theRR may determine a corresponding VPN according to the RT, and determinea MAC address entry which corresponds to the VPN and includes thedestination MAC address as the MAC address entry required by the PE.

Referring to FIG. 2, the BGP ORF packet includes: a packet header, theMAC ORF, and the RT ORF, where the MAC ORF carries the destination MACaddress, and the RT ORF carries the RT.

Referring to FIG. 3a , the MAC ORF includes the following fields: ORFtype, length, MAC ORF entry 1, a MAC ORF entry 2 . . . . A length of theORF type field may be selected as 1 byte, a length of the length fieldmay be selected as 2 bytes, and each MAC ORF entry has 8 bytes in total,where 1 byte is for a standard header, 1 byte is reserved (reserved),and 6 bytes are for a MAC address value. The 6-byte MAC address value isa destination MAC address of the data packet.

Referring to FIG. 3b , the 1-byte standard header includes: a 2-bitaction (Action) field, a 1-bit match (MATCH) field, and a 5-bit reservedpart. For values of Action, 0 represents addition (ADD), 1 representsremoval (REMOVE), 2 represents removal-All (REMOVE-ALL) For values ofMATCH, 0 represents permit (PERMIT), 1 represents (DENY).

In this embodiment, the BGP ORF packet is used for the PE to acquire theMAC address entry. To differentiate from a subsequent BGP ORF packet forremoving the MAC address entry, the BGP ORF packet in this embodimentmay be referred to as a first BGP ORF packet, and the subsequent packetfor removing may be referred to as second BGP ORF packet. A value ofAction in the first BGP ORF packet is 0, and a value of Action in thesecond BGP ORF packet is 1. In addition, a format of the RT ORF issimilar to that of the MAC ORF shown in FIG. 3a . What is different fromthe MAC ORF is that, a value of an ORF type in the RT ORF is a valueindicating the RT ORF, and moreover, the RT ORF includes an RT field forcarrying the RT, rather than a MAC address field.

Alternatively, the first packet may also be a data packet that the PEforwards to the RR, where the data packet includes the destination MACaddress, and then the RR may directly acquire the destination MACaddress from the data packet. In addition, the data packet furtherincludes a label, where the label may identify a corresponding VPN. TheRR may determine a corresponding VPN according to the label, and thenthe RR may determine a MAC address entry which corresponds to the VPNand includes the destination MAC address as the MAC address entryrequired by the PE. In the embodiment of the present disclosure, thelabel refers to a multi-protocol label switching (MPLS) label.

Step 12: The PE receives a packet which includes the required MACaddress entry and is sent by the RR, and stores the required MAC addressentry.

In the prior art, PEs transmits MAC address entries of VPN Sites, towhich the PEs connect, to each other, so that each PE stores MAC addressentries of the VPN Sites to which all the PEs connect. In existing RRnetworking, the PEs send the MAC address entries of the VPN Sites, towhich the PEs connect, to the RR, and the RR is responsible forforwarding the MAC address entries to other PEs. Different from theprior art, in this embodiment, the PE only requests the required MACaddress entry from the RR, so that the MAC address entry is storedaccording to need.

Further, after storing the MAC address entry, the PE may forward thereceived data packet according to the MAC address entry because the MACaddress entry may indicate routing information.

In this embodiment, the PE sends the first packet to the RR, and the RRdetermines the MAC address entry required by the PE according to thefirst packet, so that the PE only stores the MAC address entry requiredby itself rather than MAC address entries corresponding to all PEs,thereby implementing that the PE stores the MAC address entry accordingto need, and reducing demands for capacity and performance of the PE.

FIG. 4 is a schematic flow chart of an embodiment of a method forsending a MAC address entry according to the present disclosure, wherethe method includes the following.

Step 41: An RR receives a first packet sent by a PE.

As described above, the first packet may be a first BGP ORF packet, ormay also be a data packet.

Step 42: The RR determines a MAC address entry required by the PEaccording to the first packet, where the RR pre-stores a MAC addresstable including the required MAC address entry.

For example, when the first packet is the first BGP ORF packet includinga destination MAC address and an RT, the RR determines a VPNcorresponding to the RT according to a pre-stored correspondingrelationship between an RT and a VPN, and then determines a MAC addressentry which includes the destination MAC address and is included in aMAC address table corresponding to the VPN as the required MAC addressentry according to a pre-stored corresponding relationship between a VPNand a MAC address table.

Alternatively, when the first packet is the data packet, the RRdetermines a corresponding VPN according to a label, and then determinesa MAC address entry which includes the destination MAC address and isincluded in a MAC address table corresponding to the VPN as the requiredMAC address entry, where in the embodiment of the present disclosure,the label refers to a multi-protocol label switching (MPLS) label.

Step 43: The RR sends the required MAC address entry to the PE.

In this embodiment, the RR receives the first packet sent by the PE, andthe RR determines the MAC address entry required by the PE according tothe first packet, so that the PE only stores the MAC address entryrequired by itself rather than MAC address entries corresponding to allPEs, thereby implementing that the PE stores the MAC address entryaccording to need, and reducing demands for capacity and performance ofthe PE.

FIG. 5 is a schematic flow chart of another embodiment of a method forstoring a MAC address entry according to the present disclosure, wherethe method includes the following.

Step 501: An RR establishes a BGP neighbor relationship with all PEs inEVPN networking.

FIG. 5 only shows a PE1 and a PE2 that communicate with each other.

The RR may establish a BGP neighbor relationship with a PE using amanual configuration manner.

After establishing the BGP neighbor relationship, the RR and the PE maytransmit a packet to each other.

In addition, in the embodiment of the present disclosure, the RR mayrefer to one RR, and may also refer to an RR group. In a case of the RRgroup, each RR or a designated RR establishes a BGP neighborrelationship with each PE, and acquires a MAC address entrysubsequently. The designated RR may be pre-configured, or the designatedRR may notify the PE that it is the designated RR.

Step 502: The PE1 and the PE2 separately send a MAC address entry to theRR.

The MAC address entry is a MAC address entry corresponding to each VPN,to which each PE connects. For example, taking the PE1 as an example,and assuming that VPNs connected to the PE1 are a VPN1 and a VPN2, theMAC address entries sent by the PE1 include a MAC address entrycorresponding to the VPN1 and a MAC address entry corresponding to theVPN2. In different VPNs, the same MAC address may be used.

The PE sends the MAC address entry to the RR, and the RR may acquire MACaddress entries of VPN Sites, to which all PEs connect, in the EVPNnetworking. The MAC address entries may form a MAC address table, sothat the RR can send required MAC address entries to different PEssubsequently.

In addition, in this embodiment, after receiving a MAC address entrysent by a PE, the RR does not forward the MAC address entry to a peerbefore receiving a MAC address request sent by the peer. For example,after receiving the MAC address entry sent by the PE1, the RR does notforward the MAC address entry to the PE2 before receiving a MAC addressrequest sent by the PE2, so as to avoid a problem resulting from thateach PE stores all MAC addresses.

Step 503: After receiving a data packet, the PE1 sends a first BGP ORFpacket to the RR.

Because the PE1 needs to forward the received data packet, the PE1 needsto know a MAC address entry corresponding to the data packet.

Referring to FIG. 2, FIG. 3a , and FIG. 3b , the first BGP ORF packetincludes a destination MAC address, an RT and a standard header forindicating that a MAC address is added. The PE1 may directly acquire thedestination MAC address from the data packet; for the RT, the PE1 maydetermine a VPN, to which the data packet belongs, according to aninbound interface of the data packet, and then obtain the foregoing RTaccording to a configured corresponding relationship between a VPN andan RT.

In addition, the foregoing data packet is preferably an initial datapacket, and the initial data packet refers to a data packet, thedestination MAC address of which is not included in a MAC address tablestored locally.

Step 504: The RR determines a MAC address entry required by the PE1according to the received first BGP ORF packet.

For example, the RT of the first BGP ORF packet is an RT1, and the RRmay obtain that a VPN corresponding to the RT1 is a VPN1 according tothe configured corresponding relationship between an RT and a VPN.Moreover, because there is a corresponding relationship between a VPNand a MAC address table in an address table stored by the RR, the RR mayfind a MAC address table corresponding to the VPN1. The MAC addresstable corresponding to the VPN1 may include multiple entries, and the RRdetermines an entry including the destination MAC address carried in thefirst BGP ORF packet as the MAC address entry required by the PE1.

Step 505: The RR sends the MAC address entry required by the PE1 to thePE1.

Afterwards, the PE1 may store the MAC address entry.

Further, the MAC address table is formed by one or multiple MAC addressentries. To improve storage efficiency of the PE, an aging mechanism mayalso be used, so that the MAC address table stored in the PE is enabledto change dynamically. That is, the method may further include thefollowing.

Step 506: The PE1 determines a first MAC address, where the first MACaddress is a MAC address included in a MAC address entry that needsaging in the MAC address table stored in the PE1.

The PE1 may determine the first MAC address using the following manner.

After storing the MAC address entry, the PE1 continues to receive a datapacket, and if a destination MAC address in the data packet is in thestored MAC address entry, the data packet may be forwarded according tothe stored MAC address entry.

Within a set time period, if the PE1 does not receive a data packet, thedestination MAC address of which is a certain MAC address in the storedMAC address table, the PE1 may determine the certain MAC address as theforegoing first MAC address.

In addition, after determining MAC address entries required by the PEs,if these MAC address entries are updated, the RR sends update of therequired MAC address entries to the PE. When the PE1 ages a certain MACaddress entry, in order to reduce a signaling overhead, the PE1 may beinstructed not to send update of the aged MAC address entry, namely, themethod may further include the following.

Step 507: The PE1 sends a second BGP ORF packet to the RR.

Reference may be made to the BGP ORF packet shown in FIG. 2 for a formatof the second BGP ORF packet. What is different from the first BGP ORFpacket is that, Action in the first BGP ORF packet is equal to 0, whileAction in the second BGP ORF packet is equal to 1.

Step 508: After receiving the second BGP ORF packet, the RR sends a BGPwithdraw packet to the PE1, where the BGP withdraw packet includes a MACaddress entry to which the first MAC address belongs.

Step 509: After sending the BGP withdraw packet, the RR does not send anupdate message of the MAC address entry including the first MAC addressto the PE1 any more.

Step 510: After receiving the BGP withdraw packet, the PE1 removes theMAC address entry including the first MAC address.

In this embodiment, the PE sends the BGP ORF packet to the RR, and theRR determines the MAC address entry required by the PE according to theBGP ORF packet, which may implement that the PE only stores the MACaddress entry required by itself rather than MAC address entriescorresponding to all PEs, thereby implementing that the PE stores theMAC address entry according to need, and reducing demands for capacityand performance of the PE; and furthermore, in this embodiment, theaging mechanism may be used to improve the storage efficiency.

FIG. 6 is a schematic flow chart of another embodiment of a method forstoring a MAC address entry according to the present disclosure, wherethe method includes the following.

Step 601: An RR establishes a BGP neighbor relationship with all PEs inEVPN networking.

Step 602: A PE1 and a PE2 separately send a MAC address entry to the RR.

Reference may be made to steps 501 to 502 for specific content of theforegoing steps 601 to 602.

Step 603: The RR sends a default MAC address entry to the PE.

The default MAC address entry is used for instructing the PE to forwarda data packet to the RR if a destination MAC address included in thedata packet received by the PE is not in a local MAC address table. Forexample, a destination MAC address of a data packet received by the PE1is a MAC1, but there is no information of the MAC1 in a locally storedMAC address table of the PE1, so the PE1 forwards the data packet to theRR according to a forwarding action corresponding to the default MACaddress entry.

Specifically, it may be pre-configured in the PE that, when an initialdata packet is received, forwarding it according to the default MACaddress entry, and the forwarding action corresponding to the defaultMAC address entry is to forward the packet to the RR. For example, thedefault MAC address entry includes the following information: a defaultMAC address (for example, all zeros) and a corresponding forwardingaction (for example, tunnel information corresponding to a next hop, anda label operation instruction). An address of the next hop of theforwarding action is an IP address of the RR, and the label operationinstruction is used for instructing the PE to attach a designated labelwhen forwarding the data packet, so that a recipient can determine a VPNto which the data packet belongs according to the label.

Step 604: When receiving the initial data packet, the PE1 forwards theinitial data packet to the RR.

The initial data packet refers to a received data packet, thedestination MAC address of which is not in the locally stored MACaddress table.

The PE1 already acquires the default MAC address entry, and the defaultMAC address entry instructs forwarding of the initial data packet to theRR, so the PE1 forwards the initial data packet to the RR according tothe default MAC address entry.

Step 605: The RR forwards the initial data packet to the PE2.

Because the RR has MAC address entries of all PEs, the RR may implementforwarding of the initial data packet according to the MAC addressentries.

Step 606: The RR determines a MAC address entry required by the PE1according to the initial data packet.

The RR may acquire the destination MAC address from the data packet,acquire VPN information according to the label of the data packet, andthen determine, according to a corresponding relationship between a VPNand a MAC address table, a MAC address table corresponding to the VPN towhich the data packet belongs, and finally determine an entry whichincludes the destination MAC address and is included in thecorresponding MAC address table as the MAC address entry required by thePE1.

Step 607: The RR sends the MAC address entry required by the PE1 to thePE1.

Afterwards, the PE1 may store the MAC address entry.

Furthermore, similar to the previous embodiment, an aging procedure maybe further included, for example, the method may further includes thefollowing.

Step 608: The PE1 determines a first MAC address, where the first MACaddress is a MAC address in a MAC address entry that needs aging in theMAC address table stored in the PE1.

Step 609: The PE1 sends a second BGP ORF packet to the RR.

Step 610: After receiving the second BGP ORF packet, the RR sends a BGPwithdraw (withdraw) packet to the PE1, where the BGP withdraw packetincludes a MAC address entry to which the first MAC address belongs.

Step 611: After sending the BGP withdraw packet, the RR does not send anupdate message of the MAC address entry including the first MAC addressto the PE1 any more.

Step 612: After receiving the BGP withdraw packet, the PE1 removes theMAC address entry including the first MAC address.

Reference may be made to steps 506 to 510 for specific content of steps608 to 612.

In this embodiment, the PE sends the initial data packet to the RR, andthe RR determines the MAC address entry required by the PE according tothe initial data packet, which may implement that the PE only stores theMAC address entry required by itself rather than MAC address entriescorresponding to all PEs, thereby implementing that the PE stores theMAC address entry according to need, and reducing demands for capacityand performance of the PE. Moreover, in this embodiment, an agingmechanism may be used to improve storage efficiency; and furthermore, inthis embodiment, the RR has an initial data packet forwarding function,which may avoid a delay of the initial data packet, and improve systemperformance.

FIG. 7 is a schematic structural diagram of an embodiment of a devicefor storing a MAC address entry according to the present disclosure. Thedevice is, for example, a PE. The device includes a first sending module71 and a storage module 72. The first sending module 71 is configured tosend a first packet to an RR, so that the RR determines a MAC addressentry required by the PE according to the first packet, where the RRpre-stores a MAC address table, and the MAC address table includes therequired MAC address entry. The storage module 72 is configured toreceive a packet which includes the required MAC address entry and issent by the RR, and store the required MAC address entry.

Referring to FIG. 8, the device for storing the MAC address entry mayfurther include: a receiving module 73 and a determining module 74. Thereceiving module 73 is configured to receive a data packet, where thedata packet includes a destination MAC address. The determining module74 is configured to determine a VPN to which the data packet belongs.The first sending module 71 is specifically configured to send the firstpacket to the RR, where the first packet includes the destination MACaddress and information for indicating the VPN.

Optionally, the first sending module 71 is specifically configured to:send a first BGP ORF packet, where the first BGP ORF packet is a packetcombining first MAC ORF and RT ORF. The first MAC ORF includes thedestination MAC address and a standard header for indicating that thedestination MAC address is added, and the RT ORF includes an RTcorresponding to the VPN to which the data packet belongs, so that theRR determines a corresponding VPN according to the RT, and determines aMAC address entry which corresponds to the VPN and includes thedestination MAC address as the required MAC address entry.

Optionally, the first sending module 71 is specifically configured to:forward the data packet received by the receiving module 73 to the RR,where the data packet includes the destination MAC address and a labelfor indicating the VPN, so that the RR determines a corresponding VPNaccording to the label, and determines a MAC address entry whichcorresponds to the VPN and includes the destination MAC address as therequired MAC address entry.

Referring to FIG. 9, the device may further include: a second sendingmodule 75 and a removing module 76. The second sending module 75 isconfigured to send a second BGP ORF packet to the RR, where the secondBGP ORF packet is a packet combining second MAC ORF and RT ORF. Thesecond MAC ORF includes a first MAC address and a standard header forinstructing removing of the first MAC address, and the RT ORF includesan RT, so that after receiving the second BGP ORF packet, the RRdetermines a corresponding VPN and a MAC address entry which correspondsto the VPN and includes the first MAC address according to the RT andsends a BGP withdraw packet to the PE. The BGP withdraw packet includesa MAC address entry to which the first MAC address belongs, so that anupdate message of the MAC address entry which corresponds to the VPN andincludes the first MAC address is not sent to the PE any more. Theremoving module 76 is configured to receive the BGP withdraw packet, andthen remove the MAC address entry including the first MAC address.

Referring to FIG. 10, the data packet is a data packet which is receivedby the PE for the first time and includes the destination MAC address.The device further includes: a third sending module 77, configured toforward the data packet which is received for the first time andincludes the destination MAC address to the RR, and the data packet isforward to a peer PE through the RR.

Referring to FIG. 11, the device further includes: an acquiring module78, configured to acquire a default MAC address entry, where the defaultMAC address entry is used to forward the data packet to the RR when thedestination MAC address included in the received data packet is not in alocal MAC address table.

In this embodiment, the PE sends the first packet to the RR, and the RRdetermines the MAC address entry required by the PE according to thefirst packet, which may implement that the PE only stores the MACaddress entry required by itself rather than MAC address entriescorresponding to all PEs, thereby implementing that the PE stores theMAC address entry according to need, and reducing demands for capacityand performance of the PE.

FIG. 12 is a schematic structural diagram of an embodiment of a devicefor sending a MAC address entry according to the present disclosure. Thedevice may be an RR. The device includes a receiving module 121, adetermining module 122, and a sending module 123. The receiving module121 is configured to receive a first packet sent by a PE. Thedetermining module 122 is configured to determine a MAC address entryrequired by the PE according to the first packet, where the RRpre-stores a MAC address table including the required MAC address entry.The sending module 123 is configured to send the required MAC addressentry to the PE.

Optionally, the receiving module is specifically configured to receive afirst BGP ORF packet sent by the PE, where the first BGP ORF packet is apacket combining first MAC ORF and RT ORF. The first MAC ORF includes adestination MAC address and a standard header for indicating that thedestination MAC address is added, and the RT ORF includes an RT. Thedestination MAC address is a destination MAC address included in a datapacket received by the PE, and the RT is an RT corresponding to a VPN towhich the data packet belongs.

The determining module is specifically configured to determine acorresponding VPN according to the RT, and determine a MAC address entrywhich corresponds to the VPN and includes the destination MAC address asthe required MAC address entry.

Optionally, the receiving module is specifically configured to receive adata packet forwarded by the PE, where the data packet includes thedestination MAC address and a label for indicating the VPN.

The determining module is specifically configured to determine a VPNaccording to the label, and determine a MAC address entry whichcorresponds to the VPN and includes the destination MAC address as therequired MAC address entry.

Referring to FIG. 13, the device further includes a processing module124, configured to receive a second BGP ORF packet sent by the PE,determine a VPN corresponding to the RT and an address entry includingthe first MAC address in the MAC address table which corresponds to theVPN, and send a BGP withdraw packet to the PE. The second BGP ORF packetis a packet combining second MAC ORF and RT ORF. The second MAC ORFincludes a first MAC address and a standard header for instructingremoving of the first MAC address, and the RT ORF includes an RT. Thefirst MAC address is a MAC address which is in the required MAC addressentry and not included in a destination MAC address of a data packetsubsequently received by the PE within set time. The BGP withdraw packetincludes a MAC address entry to which the first MAC address belongs, sothat the PE removes the MAC address entry including the first MACaddress after receiving the BGP withdraw packet. After the BGP withdrawpacket is sent, an update message of the MAC address entry including thefirst MAC address is not sent to the PE any more.

Referring to FIG. 14, the device further includes: a forwarding module125, configured to receive an initial data packet forwarded by the PE,and forward the initial data packet to a peer PE, where the initial datapacket is a data packet which is received by the PE for the first timeand the destination MAC address of which is not in a local MAC addresstable of the PE.

Referring to FIG. 15, the device further includes: a notification module126, configured to send a default MAC address entry to the PE, where thedefault MAC address entry is used to instruct the PE to forward the datapacket to the RR when the destination MAC address included in thereceived data packet is not in the local MAC address table of the PE.

Referring to FIG. 16, the device further includes: an establishingmodule 127, configured to establish a BGP neighbor relationship witheach PE, receive and store a MAC address entry corresponding to a VPNconnected to each PE through the neighbor relationship, and obtain theMAC address table.

In this embodiment, the PE sends the first packet to the RR, and the RRdetermines the MAC address entry required by the PE according to thefirst packet, which may implement that the PE only stores the MACaddress entry required by itself rather than MAC address entriescorresponding to all PEs, thereby implementing that the PE stores theMAC address entry according to need, and reducing demands for capacityand performance of the PE.

FIG. 17 is a schematic structural diagram of an embodiment of a networksystem according to the present disclosure. The network system includesa first device 171 and a second device 172, where the first device 171may be illustrated as any one of FIG. 7 to FIG. 11, and the seconddevice 172 may be illustrated as any one of FIG. 12 to FIG. 16.

In this embodiment, the PE sends the first packet to the RR, and the RRdetermines the MAC address entry required by the PE according to thefirst packet, which may implement that the PE only stores the MACaddress entry required by itself rather than MAC address entriescorresponding to all PEs, thereby implementing that the PE stores theMAC address entry according to need, and reducing demands for capacityand performance of the PE. Persons of ordinary skill in the art mayunderstand that all or part of the steps of the foregoing methodembodiments may be implemented by a program instructing relevanthardware. The program may be stored in a computer readable storagemedium. When the program is run, the steps of the foregoing methodembodiments are performed. The storage medium may be any medium that iscapable of storing program codes, such as a ROM, a RAM, a magnetic disk,and an optical disk.

Finally, it should be noted that the foregoing embodiments are merelyintended for describing the technical solutions of the presentdisclosure rather than limiting the present disclosure. Although thepresent disclosure is described in detail with reference to theforegoing embodiments, persons of ordinary skill in the art shouldunderstand that they may still make modifications to the technicalsolutions described in the foregoing embodiments, or make equivalentreplacements to part of or all of the technical features; however, thesemodifications or replacements do not make the essence of thecorresponding technical solutions depart from the scope of the technicalsolutions in the embodiments of the present disclosure.

What is claimed is:
 1. A method, comprising: sending, by a providernetwork edge (PE), a first border gateway protocol outbound route filter(BGP ORF) packet to a route reflector (RR), wherein the first BGP ORFpacket comprises a first media access control (MAC) outbound routefilter (ORF) and a first route target (RT) ORF, the first MAC ORFcomprises a first MAC address of a data packet, and the first RT ORFcomprises a first RT corresponding to a first Ethernet virtual privatenetwork (EVPN) to which the data packet belongs; receiving, by the PEfrom the RR, a first packet comprising a MAC address entry, wherein theMAC address entry indicates routing information corresponding to thefirst MAC address; and storing the MAC address entry.
 2. The methodaccording to claim 1, wherein before sending the first BGP ORF packet tothe RR, the method further comprises: receiving, by the PE, the datapacket, wherein the data packet comprises the first MAC address; anddetermining, by the PE, the first EVPN to which the data packet belongs.3. The method according to claim 1, wherein the data packet is a datapacket which is received by the PE for a first time and comprises thefirst MAC address.
 4. The method according to claim 1, wherein the firstMAC ORF further comprises a first header indicating that the first MACORF includes the first MAC address.
 5. The method according to claim 4,wherein after storing the MAC address entry, the method furthercomprises: within a set time period, when a second MAC address of asubsequently received data packet does not comprise a third MAC addressthat is comprised in the MAC address entry, sending, by the PE, a secondBGP ORF packet comprising the third MAC address to the RR, wherein thesecond BGP ORF packet comprises a second MAC ORF and a second RT ORF,the second MAC ORF comprises the third MAC address and a second headerinstructing removal of the third MAC address, and the second RT ORFcomprises a second RT; and after receiving a BGP withdraw packet,removing, by the PE, the MAC address entry, wherein the MAC addressentry comprises the third MAC address.
 6. The method according to claim1, wherein the MAC address entry comprises a next hop to the first MACaddress.
 7. A method, comprising: receiving, by a route reflector (RR),a first border gateway protocol outbound route filter (BGP ORF) packetsent by a provider network edge (PE), wherein the first BGP ORF packetcomprises a first media access control (MAC) outbound route filter (ORF)and a first route target (RT) ORF, the first MAC ORF comprises a firstMAC address, the first RT ORF comprises a first RT, the first MACaddress is comprised in a data packet received by the PE, and the firstRT corresponds to a first Ethernet virtual private network (EVPN) towhich the data packet belongs; determining, by the RR, the first EVPNcorresponding to the first RT; determining, by the RR, a MAC addressentry, where the MAC address entry corresponds to the first EVPN and theMAC address entry indicates routing information corresponding to thefirst MAC address, wherein a MAC address table comprising the MACaddress entry is stored in the RR; and sending, by the RR, the MACaddress entry to the PE.
 8. The method according to claim 7, furthercomprising: establishing, by the RR, a BGP neighbor relationship withanother PE; and receiving and storing, by the RR, a MAC address entrycorresponding to another VPN connected to the another PE.
 9. The methodaccording to claim 8, further comprising: receiving, by the RR, a secondBGP ORF packet sent by the PE, wherein the second BGP ORF packetcomprises a second MAC ORF and a second RT ORF, the second MAC ORFcomprises a second MAC address and a first header instructing removal ofthe second MAC address, the second RT ORF comprises a second RT, and thesecond MAC address is comprised in the MAC address entry and notcomprised in a third MAC address of a data packet subsequently receivedby the PE within a set time period; after receiving the second BGP ORFpacket, determining, by the RR, a second EVPN corresponding to thesecond RT and an address entry in a MAC address table which correspondsto the second EVPN and comprises the second MAC address; and sending, bythe RR, a BGP withdraw packet to the PE, wherein the BGP withdraw packetcomprises a MAC address entry to which the second MAC address belongs,wherein after receiving the BGP withdraw packet, the PE removes the MACaddress entry comprising the second MAC address.
 10. The methodaccording to claim 8, wherein the MAC address entry further comprises anext hop to the first MAC address.
 11. The method according to claim 7,wherein the first MAC ORF further comprises a second header indicatingthat the first MAC ORF includes the first MAC address.
 12. A device,comprising: a processor; and a non-transitory computer-readable storagemedium storing a program to be executed by the processor to cause thedevice to: send a first border gateway protocol outbound route filter(BGP ORF) packet to a route reflector (RR) to require a media accesscontrol (MAC) address entry, wherein the first BGP ORF packet comprisesa first MAC outbound route filter (ORF) and a first route target (RT)ORF, the first MAC ORF comprises a first MAC address of a data packet,and the first RT ORF comprises a first RT corresponding to a firstEthernet virtual private network (EVPN) to which the data packetbelongs; and receive a packet which comprises the MAC address entry andis sent by the RR, wherein the MAC address entry indicates routinginformation corresponding to the first MAC address; and wherein thedevice is configured to store the MAC address entry.
 13. The deviceaccording to claim 12, wherein the program, when executed by theprocessor, cause the device to: receive the data packet, wherein thedata packet comprises the first MAC address; and determine the firstEVPN to which the data packet belongs.
 14. The device according to claim12, wherein the first MAC ORF further comprises a first headerindicating that the first MAC ORF includes the first MAC address. 15.The device according to claim 14, wherein the program, when executed bythe processor, causes the device to: send a second BGP ORF packet to theRR, wherein the second BGP ORF packet comprises a second MAC ORF andsecond RT ORF, the second MAC ORF comprises a second MAC address and asecond header instructing removing of the second MAC address, and thesecond RT ORF comprises a second RT; and after a BGP withdraw packet isreceived, remove the MAC address entry comprising the second MACaddress.
 16. The device according to claim 12, wherein the MAC addressentry comprises a next hop to the first MAC address.
 17. A device,comprising: a processor; and a non-transitory computer-readable storagemedium storing a program to be executed by the processor to cause thedevice to: receive a first border gateway protocol outbound route filter(BGP ORF) packet sent by a provider network edge (PE), wherein the firstBGP ORF packet comprises a first media access control (MAC) outboundroute filter (ORF) and a first route target (RT) ORF, the first MAC ORFcomprises a first MAC address, the first RT ORF comprises a first RT,the first MAC address is comprised in a data packet received by the PE,and the first RT corresponds to a first Ethernet virtual private network(EVPN) to which the data packet belongs; determine the first EVPNaccording to the first RT, and determine a MAC address entry whichcorresponds to the first EVPN and the MAC address entry indicatesrouting information corresponding to the first MAC address, wherein thedevice is configured to store a MAC address table comprising the MACaddress entry; and send the MAC address entry to the PE; and wherein thedevice is further configured to configured to store the MAC addresstable.
 18. The device according to claim 17, wherein the program, whenexecuted by the processor, cause the device to: establish a BGP neighborrelationship with another PE, receiving and storing MAC address entrycorresponding to another EVPN connected to the another PE.
 19. Thedevice according to claim 17, wherein the first MAC ORF furthercomprises a first header indicating that the first MAC ORF includes thefirst MAC address.
 20. The device according to claim 19, wherein theprogram, when executed by the processor, cause the device to: receive asecond BGP ORF packet sent by the PE, wherein the second BGP ORF packetcomprises a second MAC ORF and a second RT ORF, the second MAC ORFcomprises a second MAC address and a second header instructing removingof the second MAC address, the second RT ORF comprises a second RT, thesecond MAC address is comprised in the MAC address entry and notcomprised in a second MAC address of a data packet subsequently receivedby the PE within a set time period; after receiving the second BGP ORFpacket, determine a second EVPN corresponding to the second RT and anaddress entry which corresponds to the second EVPN and comprises thesecond MAC address in the MAC address table; and send a BGP withdrawpacket to the PE, wherein the BGP withdraw packet comprises a MACaddress entry to which the second MAC address belongs.
 21. The deviceaccording to claim 17, wherein the MAC address entry further comprises anext hop to the first MAC address.